namespace Maple.Branch.IdentityServer.Entities
{
    using System;
    using IdentityServer4;
    using JetBrains.Annotations;
    using Volo.Abp;
    using Volo.Abp.Domain.Entities;

    public abstract class Secret : Entity
    {
        public virtual string Type { get; protected set; }

        public virtual string Value { get; set; }

        public virtual string Description { get; set; }

        public virtual DateTime? Expiration { get; set; }

        protected Secret()
        {
        }

        protected Secret(
            [NotNull] string value,
            DateTime? expiration = null,
            string type = IdentityServerConstants.SecretTypes.SharedSecret,
            string description = null)
        {
            Check.NotNull(value, nameof(value));

            Value = value;
            Expiration = expiration;
            Type = type;
            Description = description;
        }
    }
}
